<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, minimal-ui">
    <title>MobioKit - Premium Mobile Template</title>
    <link rel="stylesheet" href="../../vendor/swiper/swiper.min.css">
    <link rel="stylesheet" href="css/style.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">

</head>

<body>



    <div class="page page--main" data-page="shop" id='app'>

        <!-- PAGE CONTENT -->
        <div class="page__content page__content--with-bottom-nav" style="height: 100%;">

            <header class="header header--gradient header--fixed header--change">
                <div class="header__inner">
                    <div class="header__icon">
                        <a href="tables3.html"><img src="../../assets/images/icons/white/arrow-back.svg" alt="" title="" /></a>
                    </div>
                    <div class="header__icon header__icon--cart open-panel" data-panel="right"></div>
                </div>
            </header>

            <!-- SLIDER SIMPLE -->
            <div class="swiper-container slider-simple slider-simple slider-simple--vw-width mb-20 slider-init" data-paginationtype="bullets" data-spacebetweenitems="0" data-itemsperview="1">
                <div class="swiper-wrapper">
                    <div v-for="(item,i) in checkItem.imgs" class="swiper-slide slider-simple__slide" v-bind:style="{backgroundImage:'url('+ serverUrl+ item + ')'}">
                    </div>

                </div>
                <div class="swiper-pagination slider-simple__pagination"></div>

            </div>

            <div class="d-flex justify-space align-items-center mb-20">
                <h2 class="page__title mb-0">{{checkItem.TESTNAME}}</h2>
                <div class="shop-details-price">{{checkItem.ISRECTIFY===1?'整改':'满分'}}</div>
            </div>

            <p class="welcome">
                {{checkItem.QUESTION}}
            </p>
            <h3>打分</h3>
            <div class="color-selectors">
                <div class="cart__total cart__total--page">
                    <div v-for="(item,i) in dataList" class=" d-flex align-items-center justify-space pb-10 ">
                        <span>{{item['7STILE']}}（{{item['7SSCORE']}}）</span> <b>得分：{{item.SCORE}}</b>
                        <!-- <span>{{item.ID}}</span> <b>得分：{{item.SCORE}}</b> -->
                    </div>

                </div>

            </div>


        </div>


    </div>
    <!-- PAGE END -->



    <!-- Social Icons Popup -->
    <div id="popup-social "></div>

    <!-- Alert -->
    <div id="popup-alert "></div>

    <!-- Notifications -->
    <div id="popup-notifications "></div>

    <script src="../../vendor/jquery/jquery-3.5.1.min.js "></script>
    <script src="../../vendor/swiper/swiper.min.js "></script>
    <script src="js/swiper-init.js "></script>
    <script src="js/swiper-init-swipe.js "></script>
    <script src="js/jquery.custom.js "></script>
</body>



<script src="../../../js/vue/vue.js "></script>
<!-- <script src="js/iview/iview.min.js "></script> -->
<script src="../../../js/jsCookie/js.cookie.min.js "></script>
<script src="../../../js/axios/axios.min.js "></script>

<script src="https://cdn.jsdelivr.net/npm/vant@2.12/lib/vant.min.js "></script>
<link rel="stylesheet " href="https://cdn.jsdelivr.net/npm/vant@2.12/lib/index.css " />





<script>
    var app = new Vue({
        el: '#app',
        data: {
            user: {},
            dataList: [],
            checkDayId: '',
            checkItem: {},
            serverUrl: '',
        },
        methods: {
            getCookieUser() {
                let userJson = Cookies.get('userInfo');
                if (!userJson) {
                    this.$notify({
                        type: 'danger',
                        message: '请先登录'
                    });
                    window.location.href = '/login.html'
                    return
                }
                this.user = JSON.parse(userJson)
                if (!this.user) {
                    this.$notify({
                        type: 'danger',
                        message: '请先登录'
                    });
                    window.location.href = '/login.html'
                    return
                }

                this.getUrl()
            },
            GetQueryString(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                var r = window.location.search.substr(1).match(reg);

                if (r != null)
                    return (r[2]);
                return null;
            },
            formatDate(date) {
                var date = new Date(date);
                var YY = date.getFullYear() + '-';
                var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
                var DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
                var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
                var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
                var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
                return YY + MM + DD + " " + hh + mm + ss;
            },
            getDataTable() {
                let formData = new FormData();
                formData.append("checkDayId ", this.checkDayId);
                axios
                    .post(
                        "http://10.11.41.128:30010/checkDay/findCheckDayDetailedByCheckDayId?ticket=" + Cookies.get('ticket'),
                        formData, {
                            headers: {
                                "Content-Type": "multipart/form-data",
                                "token": this.user.token,
                            },
                        }
                    )
                    .then(res => {
                        if (res.data === null || res.data === " ") return;
                        if (res.data.status === 1) {
                            console.log(res.data)

                            this.dataList = res.data.data


                        } else {
                            this.$notify({
                                type: 'danger',
                                message: '加载失败' + res.data.msg
                            });
                            if (res.data.msg === "未登录 ") {
                                window.location.href = "../../../login.html "
                            }
                        }
                    });
            },
            getUrl() {
                let formData = new FormData();
                axios
                    .post(
                        "http://10.11.41.128:30010/public/findSysImgUrl?ticket=" + Cookies.get('ticket'),
                        formData, {
                            headers: {
                                "Content-Type": "multipart/form-data",
                                "token": this.user.token,
                            },
                        }
                    )
                    .then(res => {

                        if (res.data === null || res.data === " ") return;
                        if (res.data.status === 1) {
                            console.log(res.data)

                            this.serverUrl = res.data.data


                        } else {
                            this.$notify({
                                type: 'danger',
                                message: '加载失败' + res.data.msg
                            });
                            if (res.data.msg === "未登录 ") {
                                window.location.href = "../../../login.html "
                            }
                        }
                    });
            }



        },
        mounted: function() {
            this.getCookieUser()
            let id = this.GetQueryString('cid')
            this.checkItem = JSON.parse(Cookies.get('checkItem'))

            if (this.checkItem.ID !== null && this.checkItem.ID !== '') {
                this.checkDayId = this.checkItem.ID
                this.checkItem.imgs = this.checkItem.ENCLOSURE.split(',')
                this.getDataTable()
            } else {
                this.$notify({
                    type: 'danger',
                    message: '未加载到对应7S详情'
                });
                setTimeout(() => {
                    window.location.href = 'tables3.html'
                }, 1500);

            }
        }
    })
</script>

</html>